import request from '@/utils/request'

// 创建年报
export function createReportYear(data) {
  return request({
    url: '/water/report-year/create',
    method: 'post',
    data: data
  })
}

// 更新年报
export function updateReportYear(data) {
  return request({
    url: '/water/report-year/update',
    method: 'put',
    data: data
  })
}

// 删除年报
export function deleteReportYear(id) {
  return request({
    url: '/water/report-year/delete?id=' + id,
    method: 'delete'
  })
}

// 获得年报
export function getReportYear(id) {
  return request({
    url: '/water/report-year/get?id=' + id,
    method: 'get'
  })
}

// 获得年报分页
export function getReportYearPage(query) {
  return request({
    url: '/water/report-year/page',
    method: 'get',
    params: query
  })
}

// 导出年报 Excel
export function exportReportYearExcel(query) {
  return request({
    url: '/water/report-year/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得月报
export function getReportOneYearList(date) {
  return request({
    url: '/water/report-year/get-one-year-report?date=' + date,
    method: 'get'
  })
}
